package com.example.teamtribe.main.mine.info;

import com.example.teamtribe.common.Back;
import com.example.teamtribe.common.CallbackStore;
import com.example.teamtribe.common.model.FileModel;
import com.example.teamtribe.utils.HttpUtil;
import com.example.teamtribe.utils.URLStore;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

public class MyInfoModel {

    public void uploadHead(String token, File image, final Back back) {
        FileModel.getInstance().upload(token, image, 0, back);
    }

    public void updateInfo(String token, String nickname, String portrait, int isPublic, final Back back) {
        Map<String, String> params = new HashMap<>();
        params.put("nickname", nickname);
        params.put("portrait", portrait);
        params.put("isPublic", isPublic + "");
        params.put("TeamTribeToken", token);
        HttpUtil.post(URLStore.USERINFO_UPDATE, params, CallbackStore.getCallback(back));
    }
}
